import { getQRCode } from '@/servers';
import { ref, reactive, watch } from 'vue';

const useQRCode = () => {
  const base64_img = ref('');
  const commitText = text => {
    text = text || '输入你想转换的文字';
    getQRCode(text).then(data => {
      base64_img.value = data.base64_image;
    });
  };
  commitText();
  return {
    base64_img,
    commitText
  };
};
export { useQRCode };
